package com.hl.web.fore;

import com.hl.pojo.Timu;
import com.hl.service.TimuService;
import com.hl.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/timu")
public class TimuController {
    @Autowired
    private TimuService timuService;

    @RequestMapping("/add")
    public ResultEntity add(@RequestBody Timu timu){
        timuService.add(timu);
        return ResultEntity.ok();
    }

    @RequestMapping("/del")
    public ResultEntity del(@RequestBody Timu timu){
        timuService.del(timu);
        return ResultEntity.ok();
    }
    @RequestMapping("/delType")
    public ResultEntity delType(@RequestBody Timu timu){
        timuService.delType(timu);
        return ResultEntity.ok();
    }
    @RequestMapping("/findAll")
    public ResultEntity findAll(){
        return ResultEntity.ok(timuService.findAll());
    }
    @RequestMapping("/findType")
    public ResultEntity findType(Timu timu){
        return ResultEntity.ok(timuService.findType(timu));
    }
}
